using System;
using System.Collections;

using System.Xml.Serialization;

namespace Evaluant.Uss.Models
{
	[Serializable]
	public class EntityCollection : CollectionBase
	{

		public int Add(Entity value)
		{
			return base.List.Add(value as object);
		}

		public void Remove(Entity value)
		{
			base.List.Remove( (object)value);
		}

		public void Insert(int index, Entity value)
		{
			base.List.Insert(index, (object)value);
		}

		public bool Contains(Entity value)
		{
			return base.List.Contains( (object)value);
		}

        public bool Contains(string value)
        {
            foreach (Entity entity in base.List)
                if (entity.Type == value)
                    return true;

            return false;
        }

		public Entity this[int index]
		{
			get { return ( (Entity)base.List[index]); }
		}
	}
}
